<template>
  <el-popover v-model="visibility" placement="bottom" trigger="click">
    <slot />
    <div class="t_right marTop10">
      <el-button size="mini" class="searchBtn" @click.stop="reset">{{ $t('common.reset') }}</el-button>
      <el-button type="primary" size="mini" class="searchBtn" @click.stop="changeSearch">查询</el-button>
    </div>
    <div slot="reference">
      {{ col.label }}
      <i class="el-icon-arrow-down" />
    </div>
  </el-popover>
</template>

<script>
export default {
  props: {
    col: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      visibility: false,
    };
  },
  methods: {
    changeSearch() {
      this.visibility = false;
      this.$emit('handleSearch');
    },
    reset() {
      this.$emit('handleReset');
    },
  },
};
</script>
